/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:					*/
/*	Author:		gong_libin			*/
/*	Date:		2011_09_22			*/
/*	File:		GlbArea.h			*/
/********************************************************/

#ifndef	_MTAREA_H
#define	_MTAREA_H

#include "GlbGeneral.h"

#define	GLB_REDIR_1			0x01
#define	GLB_REDIR_2			0x02

class CGlbArea
{
public:
	CGlbArea();
	virtual ~CGlbArea();

	void GlbAreaDestory();
	int GlbAreaInit(char* pszFile);
	void GlbAreaCheck(char* pszIP, char* pszArea);

protected:
	void* GlbAreaGetArea();

private:
	UCHAR* m_puszArea;

	int GlbAreaBeNumber(char cVal);
	ULONG GlbAreaGetIP(char* pszIP);
	ULONG GlbAreaGetValue(ULONG ulStart, int iLength);
	void GlbAreaGetHead(ULONG* pulStart, ULONG* pulEnd);
	ULONG GlbAreaGetString(ULONG ulStart, char* pszValue);
	ULONG GlbAreaSearch(ULONG ulStart, ULONG ulEnd, ULONG ulIP);
	void GlbAreaGetAddress(ULONG ulStart, char* pszCountry, char* pszLocation);

};

#endif /* _MTAREA_H */
